<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>1</button>
    <button>2</button>
    <button>3</button>
    <script>
        // let arr = [1,2,3];
        // let arr2 = new Array(1,2,3);
        // console.log(arr,arr2);

        // console.log(typeof Array);


        // 伪数组- 真数组
        // let btns = document.querySelectorAll('button')
        // let arr = Array.from(btns);
        // console.log(arr);

        // let arr = new Array(3);
        // console.log(arr);

        // let arr = Array.of(3,2,1);
        // console.log(arr);


        //
        // let arr =['a','b','c','d','e','f','g','h'];

        // 原型方法
        // arr.push()

        // arr.copyWithin(1,0,arr.length);
        // 参数1：要修改的起始位置下标
        // 参数2：从哪个下标开始复制
        // 参数3：复制到哪个下标 - 复制体- 结束下标（不包含下标本身）
        // arr.copyWithin(2,1,2);
        // arr.copyWithin(4,0,2);

        // console.log(arr);

        // let arr = [1,2,3,4];
        // // arr.length = 8;
        // arr.fill('ok',2,4);
        // console.log(arr);


        // 数组也算对象
        let arr = ['a','b','c','d'];

        // 下标
        // let arr2 = arr.keys();

        // // Iterator 迭代器对象
        // console.log(arr2.next());
        // console.log(arr2.next());
        // console.log(arr2.next());
        // console.log(arr2.next());
        // console.log(arr2.next());

        // console.log(arr2);

        // let arr3 = arr.values();
        // console.log(arr3.next());
        // console.log(arr3.next());
        // console.log(arr3.next());
        // console.log(arr3.next());
        // console.log(arr3.next());
        // console.log(arr3);

        // key和value的集合
        let arr4 = arr.entries();

        console.log(arr4.next());
        console.log(arr4.next().value);
        // console.log(arr4.next());
        // console.log(arr4.next());
        // console.log(arr4.next());

        // console.log(arr4);

        // let arr = ['王旭鹏','小金子','王佳乐','陈天富'];
        // console.log(arr.includes('王佳乐乐'));

        // let arr = [1,2,3,[4,5,6]];
        // console.log(arr);

        // // 拉平数组
        // console.log(arr.flat());


        // let arr = [1,2,3,[4,5,['a','b','c'],6]];
        // let arr = [1,2,3,[4,5,['a','b',[7,8,9],'c'],6]];

        // 参数：拉平几层
        // console.log(arr.flat(Infinity));




    </script>
</body>
</html>